//
//  YYJLFunnyAnswerCell.m
//  YuanyangJinlou
//
//  Created by mac004 on 2017/1/6.
//  Copyright © 2017年 suli19910309@qq.com. All rights reserved.
//

#import "YYJLFunnyAnswerCell.h"
@interface YYJLFunnyAnswerCell(){
    UILabel * currentLb;//当前关卡名
    UILabel * passYlb;//已过关提示
    UIImageView * passYview;//以过关标示
    UIImageView * passNview;//未过关提示
    UIImageView * starView;//星星
    UILabel    * ygLb;//是否过关
    
    
}
@end
@implementation YYJLFunnyAnswerCell
-(instancetype)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
        [self creatUI];
    }return self;
}
-(void)creatUI{
    UIView * bgView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 113*PER_WIDTH, 150*PER_HEIGHT)];
    bgView.layer.cornerRadius=10;
    bgView.layer.masksToBounds=YES;
    bgView.backgroundColor=[UIColor whiteColor];
    [self.contentView addSubview:bgView];
    
    currentLb=[MyControl createLabelWithFrame:CGRectMake(0, 0, bgView.width, 30*PER_HEIGHT) Font:14 Text:@"第一关" Color:WHITE_COLOR];
    currentLb.textAlignment=NSTextAlignmentCenter;
    currentLb.backgroundColor=TINK_COLOR;
    [bgView addSubview:currentLb];
    
    ygLb=[MyControl createLabelWithFrame:CGRectMake(21.5*PER_WIDTH, bgView.height-30*PER_HEIGHT, 70*PER_WIDTH, 25*PER_HEIGHT) Font:12 Text:@"已过关" Color:WHITE_COLOR];
    ygLb.layer.cornerRadius=12.5;
    ygLb.layer.masksToBounds=YES;
    ygLb.textAlignment=NSTextAlignmentCenter;
    ygLb.backgroundColor=TINK_COLOR;
    [bgView addSubview:ygLb];
    
    UIImage * starImg=[UIImage imageNamed:@"ico_xingxing"];
    starView=[[UIImageView alloc]initWithFrame:CGRectMake(ygLb.left+35*PER_WIDTH-starImg.size.width*PER_WIDTH/2, ygLb.top-10*PER_HEIGHT-starImg.size.height*PER_HEIGHT, starImg.size.width*PER_WIDTH, starImg.size.height*PER_HEIGHT)];
    starView.image=starImg;
    [bgView addSubview:starView];
    
    //已过关
    passYlb=[MyControl createLabelWithFrame:CGRectMake(0, starView.top+6*PER_HEIGHT, bgView.width, 12*PER_HEIGHT) Font:12 Text:@"已通关,获得5积分" Color:BLACK_COLOR];
    passYlb.textAlignment=NSTextAlignmentCenter;
    [bgView addSubview:passYlb];
    
    UIImage * passYImg=[UIImage imageNamed:@"ico_guoguan"];
    passYview=[[UIImageView alloc]initWithFrame:CGRectMake(bgView.width/2-passYImg.size.width/2*PER_WIDTH, passYlb.top-7*PER_HEIGHT-passYImg.size.height*PER_HEIGHT, passYImg.size.width*PER_WIDTH, passYImg.size.height*PER_HEIGHT)];
    passYview.image=passYImg;
    [bgView addSubview:passYview];
    
    passYview.hidden=YES;
    passYlb.hidden=YES;
    //未过关
    UIImage*jifenImg=[UIImage imageNamed:@"ico_jifen2"];
    passNview=[[UIImageView alloc]initWithFrame:CGRectMake(bgView.width/2-jifenImg.size.width/2*PER_WIDTH, starView.top-15*PER_HEIGHT-jifenImg.size.height*PER_HEIGHT, jifenImg.size.width*PER_WIDTH, jifenImg.size.height*PER_HEIGHT)];
    passNview.image=jifenImg;
    [bgView addSubview:passNview];
    
    UILabel * lab=[MyControl createLabelWithFrame:CGRectMake(passNview.right+10*PER_WIDTH, passNview.top+2.5*PER_HEIGHT, 30, 13) Font:13 Text:@"5" Color:UIColorFromHex(0xdea556)];
    lab.font=[UIFont fontWithName:HLT size:13];
    [bgView addSubview:lab];
    
}
@end
